package com.jack.helloworld.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.jack.helloworld.R;
import com.jack.helloworld.activity.mode.BaseActivity;
import com.jack.helloworld.util.DeviceInfoUtil;

public class LR1Activity extends BaseActivity {

	private TextView showDeviceInfo;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_lr1);
		showDeviceInfo = findViewById(R.id.showDeviceInfo);
	}
	
	public void doClick(View view) {
		Intent intent;
		switch (view.getId()) {
			case R.id.goToLazyAudio:
				intent = new Intent();
				intent.setData(Uri.parse("http://xmtm.mting.info/home"));
				startActivity(intent);
				break;
			case R.id.goToLazyAudio2:
				intent = new Intent();
				intent.setAction(Intent.ACTION_VIEW);
				intent.setData(Uri.parse("lazyaudio://"));
				intent.putExtra("uri", "lazyaudio://bookstore?type=0&entityType=1&id=17597&entityTitle=书赏&publishType=2&publishValue=17597&publishTitle=书赏");
				startActivity(intent);
				break;

			case R.id.getDevicesInfo:
				StringBuilder sb = new StringBuilder();
				sb.append("imei:" + DeviceInfoUtil.initIMEI(this)).append("\n")
						.append("imsi:" + DeviceInfoUtil.getIMSI(this)).append("\n")
						.append("mac:" + DeviceInfoUtil.getMacAddress(this)).append("\n")
						.append("androidId:" + DeviceInfoUtil.getAndroidID(this)).append("\n")
						.append("serialno:" + DeviceInfoUtil.getSerial(this)).append("\n")
						.append("deviceMd5:" + DeviceInfoUtil.getDeviceMd5()).append("\n");
				showDeviceInfo.setText(sb.toString());
				break;
		}
	}
}
